<?php
/**
* 获取表单数据通用函数
* @author 邝达峰
*/

class publicGetDataModel extends dbModel {

	/**
	* 构造函数
	* @param:  NULL
	* @return: NULL
	* @access: public
	*/
	public function __construct(){}

	/**
	 * 获取信息
	 * @param $fields 获取字段
	 * @param $where 查询条件
	 * @param $limit 条数
	 * @param $table 表名
	 * @author dora
	 */
	public   function getData($where = '',$limit = 5,$fields = '',$order = '',$table){
		$strFields = $fields?$fields:"id,shopid,pType,title,content,sortId";
		$intLimit = $limit?$limit:1;
		//$strWhere = 'id=40';
		$strWhere = $where?$where: ' 1 ';
		$strTable= $table?$table: 'corp_needs';
		$strOrder = $order?' order by '.$order. '  desc':' order by dateline desc';
		$strSql = "select {$strFields} from {$strTable}  where {$strWhere}  {$strOrder} limit {$intLimit} ";
		$arrData = $this->select($strSql);
		return $arrData;
	}
}
?>